package com.lenovo.flutter_with_bmap;

import android.app.Activity;
import android.content.Context;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding;
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

public class BMapViewFactory extends PlatformViewFactory {
    private ActivityPluginBinding activityPluginBinding;
    private FlutterPluginBinding flutterPluginBinding;
    public  BMapViewFactory(ActivityPluginBinding activityPluginBinding, FlutterPluginBinding flutterPluginBinding){
        super(StandardMessageCodec.INSTANCE);
        this.activityPluginBinding = activityPluginBinding;
        this.flutterPluginBinding = flutterPluginBinding;
    }
    @NonNull
    @Override
    public PlatformView create(@Nullable Context context, int viewId, @Nullable Object args) {
        return new BMapView(activityPluginBinding,flutterPluginBinding,args);
    }
}
